/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.base.entity.warehouse;

import com.jeesite.common.collect.ListUtils;
import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;
import com.jeesite.modules.base.entity.customer.Customer;
import com.jeesite.modules.base.entity.supplier.Supplier;
import com.jeesite.modules.sys.entity.User;
import org.hibernate.validator.constraints.Length;

import java.util.Date;
import java.util.List;

/**
 * 仓库档案Entity
 * @author shengbin
 * @version 2021-03-02
 */
@Table(name="t_warehouse", alias="a", columns={
		@Column(name="warehouse_id", attrName="warehouseId", label="仓库编号", isPK=true, queryType=QueryType.LIKE),
		@Column(name="warehouse_name", attrName="warehouseName", label="仓库名称", queryType=QueryType.LIKE),
		@Column(name="address", attrName="address", label="仓库地址", queryType=QueryType.LIKE),
		@Column(name="acreage", attrName="acreage", label="仓库面积"),
		@Column(name="area", attrName="area", label="区域"),
		@Column(name="service_provider", attrName="serviceProvider", label="海外仓服务商"),
		@Column(name="ownership", attrName="ownership", label="仓库归属"),
		@Column(name="property", attrName="property", label="仓库性质"),
		@Column(name="investor", attrName="investor", label="所属资方"),
		@Column(name="customer", attrName="customer", label="所属客户"),
		@Column(name="remarks", attrName="remarks", label="备注", isQuery=false),
		@Column(name="contact", attrName="contact", label="联系人", isQuery=false),
		@Column(name="phone", attrName="phone", label="联系电话", isQuery=false),
		@Column(name="wechat", attrName="wechat", label="微信", isQuery=false),
		@Column(name="email", attrName="email", label="邮箱", isQuery=false),
		@Column(name="insurance_company", attrName="insuranceCompany", label="保险公司", isQuery=false),
		@Column(name="insurance_information", attrName="insuranceInformation", label="保险信息", isQuery=false),
		@Column(name="total_loading_charges1", attrName="totalLoadingCharges1", label="TOTAL LOADING CHARGES", comment="TOTAL LOADING CHARGES( Currency Type 1)", isQuery=false),
		@Column(name="total_loading_charges2", attrName="totalLoadingCharges2", label="TOTAL LOADING CHARGES", comment="TOTAL LOADING CHARGES( Currency Type 2)", isQuery=false),
		@Column(name="trucking_charges", attrName="truckingCharges", label="Trucking charges", isQuery=false),
		@Column(name="offer_inculdes", attrName="offerInculdes", label="Offer inculdes", isQuery=false),
		@Column(name="offer_excludes", attrName="offerExcludes", label="Offer excludes", isQuery=false),
		@Column(name="create_by", attrName="createBy", label="创建人", isUpdate=false),
		@Column(name="create_date", attrName="createDate", label="创建日期", isUpdate=false),
		@Column(name="update_by", attrName="updateBy", label="最后修改人", isQuery=false),
		@Column(name="update_date", attrName="updateDate", label="最后修改日期", isQuery=false),
	}, joinTable={
		@JoinTable(type= JoinTable.Type.LEFT_JOIN, entity= Customer.class, attrName="customermodel", alias="u12",
				on="u12.customer_id = a.customer", columns={
				@Column(name="customer_id", label="客户编码", isPK=true),
				@Column(name="customer_name", label="客户名称", isQuery=false),
		}),
		@JoinTable(type= JoinTable.Type.LEFT_JOIN, entity= Supplier.class, attrName="supownership", alias="sup1",
				on="sup1.supplier_id = a.service_provider", columns={
				@Column(name="supplier_id", label="海外仓服务商编码", isPK=true),
				@Column(name="supplier_name", label="海外仓服务商名称", isQuery=false),
		}),
		@JoinTable(type= JoinTable.Type.LEFT_JOIN, entity= Supplier.class, attrName="supinvestor", alias="sup2",
				on="sup2.supplier_id = a.investor", columns={
				@Column(name="supplier_id", label="所属资方编码", isPK=true),
				@Column(name="supplier_name", label="所属资方名称", isQuery=false),
		}),
        @JoinTable(type = JoinTable.Type.LEFT_JOIN, entity = User.class, attrName = "createByUser", alias = "createby",
                on = "createby.user_code = a.create_by", columns = {
                @Column(name = "user_code", label = "用户编码", isPK = true),
                @Column(name = "user_name", label = "用户名称", isQuery = false),
        }),
        @JoinTable(type = JoinTable.Type.LEFT_JOIN, entity = User.class, attrName = "updateByUser", alias = "updateby",
                on = "updateby.user_code = a.update_by", columns = {
                @Column(name = "user_code", label = "用户编码", isPK = true),
                @Column(name = "user_name", label = "用户名称", isQuery = false),
        }),
},orderBy="a.update_date DESC"
)
public class Twarehouse extends DataEntity<Twarehouse> {
	
	private static final long serialVersionUID = 1L;
	private String warehouseId;		// 仓库编号
	private String warehouseName;		// 仓库名称
	private String address;		// 仓库地址
	private String acreage;		// 仓库面积
	private String area;		// 区域
	private String serviceProvider;		// 海外仓服务商
	private String ownership;		// 仓库归属
	private String property;		// 仓库性质
	private String investor;		// 所属资方
	private String customer;		// 所属客户
	private String contact;		// 联系人
	private String phone;		// 联系电话
	private String wechat;		// 微信
	private String email;		// 邮箱
	private String insuranceCompany;		// 保险公司
	private String insuranceInformation;		// 保险信息
	private Double totalLoadingCharges1;		// TOTAL LOADING CHARGES( Currency Type 1)
	private Double totalLoadingCharges2;		// TOTAL LOADING CHARGES( Currency Type 2)
	private String truckingCharges;		// Trucking charges
	private String offerInculdes;		// Offer inculdes
	private String offerExcludes;		// Offer excludes
	private List<TwarehouseOtherChargeItems> twarehouseOtherChargeItemsList = ListUtils.newArrayList();		// 子表列表
	private List<TwarehouseChargeItems> twarehouseChargeItemsList = ListUtils.newArrayList();		// 子表列表

	private Customer customermodel;
	private Supplier supownership;
	private Supplier supinvestor;
    private User createByUser;
    private User updateByUser;

	public Twarehouse() {
		this(null);
	}

	public Twarehouse(String id){
		super(id);
	}
	
	public String getWarehouseId() {
		return warehouseId;
	}

	public void setWarehouseId(String warehouseId) {
		this.warehouseId = warehouseId;
	}
	
	@Length(min=0, max=100, message="仓库名称长度不能超过 100 个字符")
	public String getWarehouseName() {
		return warehouseName;
	}

	public void setWarehouseName(String warehouseName) {
		this.warehouseName = warehouseName;
	}
	
	@Length(min=0, max=200, message="仓库地址长度不能超过 200 个字符")
	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}
	
	@Length(min=0, max=100, message="仓库面积长度不能超过 100 个字符")
	public String getAcreage() {
		return acreage;
	}

	public void setAcreage(String acreage) {
		this.acreage = acreage;
	}
	
	@Length(min=0, max=64, message="区域长度不能超过 64 个字符")
	public String getArea() {
		return area;
	}

	public void setArea(String area) {
		this.area = area;
	}
	
	@Length(min=0, max=64, message="海外仓服务商长度不能超过 64 个字符")
	public String getServiceProvider() {
		return serviceProvider;
	}

	public void setServiceProvider(String serviceProvider) {
		this.serviceProvider = serviceProvider;
	}
	
	@Length(min=0, max=2, message="仓库归属长度不能超过 2 个字符")
	public String getOwnership() {
		return ownership;
	}

	public void setOwnership(String ownership) {
		this.ownership = ownership;
	}
	
	@Length(min=0, max=2, message="仓库性质长度不能超过 2 个字符")
	public String getProperty() {
		return property;
	}

	public void setProperty(String property) {
		this.property = property;
	}
	
	@Length(min=0, max=64, message="所属资方长度不能超过 64 个字符")
	public String getInvestor() {
		return investor;
	}

	public void setInvestor(String investor) {
		this.investor = investor;
	}
	
	@Length(min=0, max=64, message="所属客户长度不能超过 64 个字符")
	public String getCustomer() {
		return customer;
	}

	public void setCustomer(String customer) {
		this.customer = customer;
	}
	
	@Length(min=0, max=100, message="联系人长度不能超过 100 个字符")
	public String getContact() {
		return contact;
	}

	public void setContact(String contact) {
		this.contact = contact;
	}
	
	@Length(min=0, max=100, message="联系电话长度不能超过 100 个字符")
	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}
	
	@Length(min=0, max=100, message="微信长度不能超过 100 个字符")
	public String getWechat() {
		return wechat;
	}

	public void setWechat(String wechat) {
		this.wechat = wechat;
	}
	
	@Length(min=0, max=100, message="邮箱长度不能超过 100 个字符")
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}
	
	@Length(min=0, max=100, message="保险公司长度不能超过 100 个字符")
	public String getInsuranceCompany() {
		return insuranceCompany;
	}

	public void setInsuranceCompany(String insuranceCompany) {
		this.insuranceCompany = insuranceCompany;
	}
	
	@Length(min=0, max=100, message="保险信息长度不能超过 100 个字符")
	public String getInsuranceInformation() {
		return insuranceInformation;
	}

	public void setInsuranceInformation(String insuranceInformation) {
		this.insuranceInformation = insuranceInformation;
	}
	
	public Double getTotalLoadingCharges1() {
		return totalLoadingCharges1;
	}

	public void setTotalLoadingCharges1(Double totalLoadingCharges1) {
		this.totalLoadingCharges1 = totalLoadingCharges1;
	}
	
	public Double getTotalLoadingCharges2() {
		return totalLoadingCharges2;
	}

	public void setTotalLoadingCharges2(Double totalLoadingCharges2) {
		this.totalLoadingCharges2 = totalLoadingCharges2;
	}
	
	@Length(min=0, max=500, message="Trucking charges长度不能超过 500 个字符")
	public String getTruckingCharges() {
		return truckingCharges;
	}

	public void setTruckingCharges(String truckingCharges) {
		this.truckingCharges = truckingCharges;
	}
	
	@Length(min=0, max=500, message="Offer inculdes长度不能超过 500 个字符")
	public String getOfferInculdes() {
		return offerInculdes;
	}

	public void setOfferInculdes(String offerInculdes) {
		this.offerInculdes = offerInculdes;
	}
	
	@Length(min=0, max=500, message="Offer excludes长度不能超过 500 个字符")
	public String getOfferExcludes() {
		return offerExcludes;
	}

	public void setOfferExcludes(String offerExcludes) {
		this.offerExcludes = offerExcludes;
	}
	
	public Date getCreateDate_gte() {
		return sqlMap.getWhere().getValue("create_date", QueryType.GTE);
	}

	public void setCreateDate_gte(Date createDate) {
		sqlMap.getWhere().and("create_date", QueryType.GTE, createDate);
	}
	
	public Date getCreateDate_lte() {
		return sqlMap.getWhere().getValue("create_date", QueryType.LTE);
	}

	public void setCreateDate_lte(Date createDate) {
		sqlMap.getWhere().and("create_date", QueryType.LTE, createDate);
	}
	
	public List<TwarehouseOtherChargeItems> getTwarehouseOtherChargeItemsList() {
		return twarehouseOtherChargeItemsList;
	}

	public void setTwarehouseOtherChargeItemsList(List<TwarehouseOtherChargeItems> twarehouseOtherChargeItemsList) {
		this.twarehouseOtherChargeItemsList = twarehouseOtherChargeItemsList;
	}
	
	public List<TwarehouseChargeItems> getTwarehouseChargeItemsList() {
		return twarehouseChargeItemsList;
	}

	public void setTwarehouseChargeItemsList(List<TwarehouseChargeItems> twarehouseChargeItemsList) {
		this.twarehouseChargeItemsList = twarehouseChargeItemsList;
	}

	public Customer getCustomermodel() {
		return customermodel;
	}

	public void setCustomermodel(Customer customermodel) {
		this.customermodel = customermodel;
	}

	public Supplier getSupownership() {
		return supownership;
	}

	public void setSupownership(Supplier supownership) {
		this.supownership = supownership;
	}

	public Supplier getSupinvestor() {
		return supinvestor;
	}

	public void setSupinvestor(Supplier supinvestor) {
		this.supinvestor = supinvestor;
	}

    public User getCreateByUser() {
        return createByUser;
    }

    public void setCreateByUser(User createByUser) {
        this.createByUser = createByUser;
    }

    public User getUpdateByUser() {
        return updateByUser;
    }

    public void setUpdateByUser(User updateByUser) {
        this.updateByUser = updateByUser;
    }
}